﻿using Caffeine.Core;

public class AddressViewModel : ModelBase
{
    #region Street1 Property

    [ModelBackingProperty(typeof(string), "Street1Property", ModelBase.StandardBehaviors, false, true)]
    protected readonly ModelProperty<string> _Street1Property = null; //Will be set by reflection.

    /// <summary>
    /// Gets the Street1 backing property
    /// </summary>
    public ModelProperty<string> Street1Property
    {
        get { return _Street1Property; }
    }

    /// <summary>
    /// Gets or sets the Street1Property.Value value. This property supports change notification. If the Street1Property.Value value changes,
    /// it will cause a change notification event for this property. This property must follow the [Street1Property - "Property"] convention for change events to work correctly.
    /// </summary>
    public string Street1
    {
        get { return Street1Property.Value; }
        set { Street1Property.Value = value; }
    }

    /// <summary>
    /// Gets the Street1Property.CommittedValue value. This property supports change notification. If the Street1Property.CommittedValue value changes,
    /// it will cause a change notification event for this property. This property must follow the [Street1 + "CommittedValue"] convention for change events to work correctly.
    /// </summary>
    public string Street1CommittedValue
    {
        get { return Street1Property.CommittedValue; }
    }

    /// <summary>
    /// Gets the Street1Property.IsDirty flag. This property supports change notification. If the Street1Property.IsDirty flag changes,
    /// it will cause a change notification event for this property. This property must follow the [Street1 + "IsDirty"] convention for change events to work correctly.
    /// </summary>
    public bool Street1IsDirty
    {
        get { return Street1Property.IsDirty; }
    }

    /// <summary>
    /// Gets the Street1Property.IsInvalid flag. This property supports change notification. If the Street1Property.IsInvalid flag changes,
    /// it will cause a change notification event for this property. This property must follow the [Street1 + "IsInvalid"] convention for change events to work correctly.
    /// </summary>
    public bool Street1IsInvalid
    {
        get { return Street1Property.IsInvalid; }
    }

    /// <summary>
    /// Gets the Street1Property.IsDefault flag. This property supports change notification. If the Street1Property.IsDefault flag changes,
    /// it will cause a change notification event for this property. This property must follow the [Street1 + "IsDefault"] convention for change events to work correctly.
    /// </summary>
    public bool Street1IsDefault
    {
        get { return Street1Property.IsDefault; }
    }

    /// <summary>
    /// Gets the Street1Property.ValidationErrors enumeration. This property supports change notification. If the Street1Property.ValidationErrors enumeration changes,
    /// it will cause a change notification event for this property. This property must follow the [Street1 + "ValidationErrors"] convention for change events to work correctly.
    /// </summary>
    public System.Collections.Generic.IEnumerable<ValidationError> Street1ValidationErrors
    {
        get { return Street1Property.ValidationErrors; }
    }

    #endregion

    #region Street2 Property

    [ModelBackingProperty(typeof(string), "Street2Property", ModelBase.StandardBehaviors, false, true)]
    protected readonly ModelProperty<string> _Street2Property = null; //Will be set by reflection.

    /// <summary>
    /// Gets the Street2 backing property
    /// </summary>
    public ModelProperty<string> Street2Property
    {
        get { return _Street2Property; }
    }

    /// <summary>
    /// Gets or sets the Street2Property.Value value. This property supports change notification. If the Street2Property.Value value changes,
    /// it will cause a change notification event for this property. This property must follow the [Street2Property - "Property"] convention for change events to work correctly.
    /// </summary>
    public string Street2
    {
        get { return Street2Property.Value; }
        set { Street2Property.Value = value; }
    }

    /// <summary>
    /// Gets the Street2Property.CommittedValue value. This property supports change notification. If the Street2Property.CommittedValue value changes,
    /// it will cause a change notification event for this property. This property must follow the [Street2 + "CommittedValue"] convention for change events to work correctly.
    /// </summary>
    public string Street2CommittedValue
    {
        get { return Street2Property.CommittedValue; }
    }

    /// <summary>
    /// Gets the Street2Property.IsDirty flag. This property supports change notification. If the Street2Property.IsDirty flag changes,
    /// it will cause a change notification event for this property. This property must follow the [Street2 + "IsDirty"] convention for change events to work correctly.
    /// </summary>
    public bool Street2IsDirty
    {
        get { return Street2Property.IsDirty; }
    }

    /// <summary>
    /// Gets the Street2Property.IsInvalid flag. This property supports change notification. If the Street2Property.IsInvalid flag changes,
    /// it will cause a change notification event for this property. This property must follow the [Street2 + "IsInvalid"] convention for change events to work correctly.
    /// </summary>
    public bool Street2IsInvalid
    {
        get { return Street2Property.IsInvalid; }
    }

    /// <summary>
    /// Gets the Street2Property.IsDefault flag. This property supports change notification. If the Street2Property.IsDefault flag changes,
    /// it will cause a change notification event for this property. This property must follow the [Street2 + "IsDefault"] convention for change events to work correctly.
    /// </summary>
    public bool Street2IsDefault
    {
        get { return Street2Property.IsDefault; }
    }

    /// <summary>
    /// Gets the Street2Property.ValidationErrors enumeration. This property supports change notification. If the Street2Property.ValidationErrors enumeration changes,
    /// it will cause a change notification event for this property. This property must follow the [Street2 + "ValidationErrors"] convention for change events to work correctly.
    /// </summary>
    public System.Collections.Generic.IEnumerable<ValidationError> Street2ValidationErrors
    {
        get { return Street2Property.ValidationErrors; }
    }

    #endregion

    #region StreetNumber Property

    [ModelBackingProperty(typeof(int), "StreetNumberProperty", ModelBase.StandardBehaviors, false, true)]
    protected readonly ModelProperty<int> _StreetNumberProperty = null; //Will be set by reflection.

    /// <summary>
    /// Gets the StreetNumber backing property
    /// </summary>
    public ModelProperty<int> StreetNumberProperty
    {
        get { return _StreetNumberProperty; }
    }

    /// <summary>
    /// Gets or sets the StreetNumberProperty.Value value. This property supports change notification. If the StreetNumberProperty.Value value changes,
    /// it will cause a change notification event for this property. This property must follow the [StreetNumberProperty - "Property"] convention for change events to work correctly.
    /// </summary>
    public int StreetNumber
    {
        get { return StreetNumberProperty.Value; }
        set { StreetNumberProperty.Value = value; }
    }

    /// <summary>
    /// Gets the StreetNumberProperty.CommittedValue value. This property supports change notification. If the StreetNumberProperty.CommittedValue value changes,
    /// it will cause a change notification event for this property. This property must follow the [StreetNumber + "CommittedValue"] convention for change events to work correctly.
    /// </summary>
    public int StreetNumberCommittedValue
    {
        get { return StreetNumberProperty.CommittedValue; }
    }

    /// <summary>
    /// Gets the StreetNumberProperty.IsDirty flag. This property supports change notification. If the StreetNumberProperty.IsDirty flag changes,
    /// it will cause a change notification event for this property. This property must follow the [StreetNumber + "IsDirty"] convention for change events to work correctly.
    /// </summary>
    public bool StreetNumberIsDirty
    {
        get { return StreetNumberProperty.IsDirty; }
    }

    /// <summary>
    /// Gets the StreetNumberProperty.IsInvalid flag. This property supports change notification. If the StreetNumberProperty.IsInvalid flag changes,
    /// it will cause a change notification event for this property. This property must follow the [StreetNumber + "IsInvalid"] convention for change events to work correctly.
    /// </summary>
    public bool StreetNumberIsInvalid
    {
        get { return StreetNumberProperty.IsInvalid; }
    }

    /// <summary>
    /// Gets the StreetNumberProperty.IsDefault flag. This property supports change notification. If the StreetNumberProperty.IsDefault flag changes,
    /// it will cause a change notification event for this property. This property must follow the [StreetNumber + "IsDefault"] convention for change events to work correctly.
    /// </summary>
    public bool StreetNumberIsDefault
    {
        get { return StreetNumberProperty.IsDefault; }
    }

    /// <summary>
    /// Gets the StreetNumberProperty.ValidationErrors enumeration. This property supports change notification. If the StreetNumberProperty.ValidationErrors enumeration changes,
    /// it will cause a change notification event for this property. This property must follow the [StreetNumber + "ValidationErrors"] convention for change events to work correctly.
    /// </summary>
    public System.Collections.Generic.IEnumerable<ValidationError> StreetNumberValidationErrors
    {
        get { return StreetNumberProperty.ValidationErrors; }
    }

    #endregion

    #region AddressType Property

    [ModelBackingProperty(typeof(AddressType), "AddressTypeProperty", ModelBase.StandardBehaviors, false, true)]
    protected readonly ModelProperty<AddressType> _AddressTypeProperty = null; //Will be set by reflection.

    /// <summary>
    /// Gets the AddressType backing property
    /// </summary>
    public ModelProperty<AddressType> AddressTypeProperty
    {
        get { return _AddressTypeProperty; }
    }

    /// <summary>
    /// Gets or sets the AddressTypeProperty.Value value. This property supports change notification. If the AddressTypeProperty.Value value changes,
    /// it will cause a change notification event for this property. This property must follow the [AddressTypeProperty - "Property"] convention for change events to work correctly.
    /// </summary>
    public AddressType AddressType
    {
        get { return AddressTypeProperty.Value; }
        set { AddressTypeProperty.Value = value; }
    }

    /// <summary>
    /// Gets the AddressTypeProperty.CommittedValue value. This property supports change notification. If the AddressTypeProperty.CommittedValue value changes,
    /// it will cause a change notification event for this property. This property must follow the [AddressType + "CommittedValue"] convention for change events to work correctly.
    /// </summary>
    public AddressType AddressTypeCommittedValue
    {
        get { return AddressTypeProperty.CommittedValue; }
    }

    /// <summary>
    /// Gets the AddressTypeProperty.IsDirty flag. This property supports change notification. If the AddressTypeProperty.IsDirty flag changes,
    /// it will cause a change notification event for this property. This property must follow the [AddressType + "IsDirty"] convention for change events to work correctly.
    /// </summary>
    public bool AddressTypeIsDirty
    {
        get { return AddressTypeProperty.IsDirty; }
    }

    /// <summary>
    /// Gets the AddressTypeProperty.IsInvalid flag. This property supports change notification. If the AddressTypeProperty.IsInvalid flag changes,
    /// it will cause a change notification event for this property. This property must follow the [AddressType + "IsInvalid"] convention for change events to work correctly.
    /// </summary>
    public bool AddressTypeIsInvalid
    {
        get { return AddressTypeProperty.IsInvalid; }
    }

    /// <summary>
    /// Gets the AddressTypeProperty.IsDefault flag. This property supports change notification. If the AddressTypeProperty.IsDefault flag changes,
    /// it will cause a change notification event for this property. This property must follow the [AddressType + "IsDefault"] convention for change events to work correctly.
    /// </summary>
    public bool AddressTypeIsDefault
    {
        get { return AddressTypeProperty.IsDefault; }
    }

    /// <summary>
    /// Gets the AddressTypeProperty.ValidationErrors enumeration. This property supports change notification. If the AddressTypeProperty.ValidationErrors enumeration changes,
    /// it will cause a change notification event for this property. This property must follow the [AddressType + "ValidationErrors"] convention for change events to work correctly.
    /// </summary>
    public System.Collections.Generic.IEnumerable<ValidationError> AddressTypeValidationErrors
    {
        get { return AddressTypeProperty.ValidationErrors; }
    }

    #endregion
}